home *** CD-ROM | disk | FTP | other *** search
/ Archive Magazine CD 1995 / Archive Magazine CD 1995.iso / discs / prog_disc / volume_1 / issue_04 / dump_progs / minidumpfn < prev    next >
Encoding:
Text File  |  1987-10-31  |  2.9 KB  |  83 lines

  1.  
  2. ÃP4ô > MiniDumpFN      : A self-contained function.
  3. ÃZ.Ý ¤minidump(margin%,threshold%,printmode%)
  4. Ãd'ô BASIC version 2.0 : 26th Oct 1987
  5. Ãn)ô Copyright         : ABACUS TRAINING
  6. Ãx:
  7. ÃŵJê left%,bottom%,right%,top%,xorigin%,yorigin%,xconvert%,yconvert%,vdu%
  8. Ã…Iê line%,x%,horizpsn%,y%,points%,pixel%,printcode%,dot%,xstep%,colour%
  9. Äê Ŷ
  10. à/î Ŷ ÿ("FX 3,0"):ï 26,12:ö:ñ " at line ";fi:ú
  11. ê
  12. Þ vdu% 39
  13. ôDç margin%<0 ☓ margin%>79 … = "margin% must be between 0 and 79."
  14. þJç threshold%<0 ☓ threshold%>255 … = "keep threshold% between 0 & 255."
  15. ÃÈHç printmode%=5 ☓ printmode%=7 ⇧ ="printmode% must be either 5 or 7."
  16. ÃÒ !(vdu%+ 0)=131       :ô top%
  17. ÃÜ!!(vdu%+ 4)=128       :ô left%
  18. Ãæ"!(vdu%+ 8)=130       :ô right%
  19. Ãð#!(vdu%+12)=129       :ô bottom%
  20. Ãú$!(vdu%+16)=136       :ô xorigin%
  21. Ä$!(vdu%+20)=137       :ô yorigin%
  22. Ä%!(vdu%+24)=  4       :ô xconvert%
  23. Ä%!(vdu%+28)=  5       :ô yconvert%
  24. Ä"3!(vdu%+32)= -1       :ô End of parameter block.
  25. Ä,&È− "OS_ReadVduVariables",vdu%,vdu%
  26. Ä6top%       =!(vdu%+ 0)
  27. Ä@left%      =!(vdu%+ 4)
  28. ÄJright%     =!(vdu%+ 8)
  29. ÄTbottom%    =!(vdu%+12)
  30. Ä^xorigin%   =!(vdu%+16)
  31. Ähyorigin%   =!(vdu%+20)
  32. Ärxconvert%  =!(vdu%+24)
  33. Ä|yconvert%  =!(vdu%+28)
  34. Äŷ:
  35. Ä‘:
  36. ÄŒHleft%  =      (left%<<xconvert%)-xorigin%    :ô These are the screen
  37. ĤGright% = ((right%+1)<<xconvert%)-xorigin%-1  :ô co-ordinates of the
  38. Ä®Hbottom%=    (bottom%<<yconvert%)-yorigin%    :ô the graphics window.
  39. ĸ3top%   =   ((top%+1)<<yconvert%)-yorigin%-1  :ô
  40. ÄÂline%=top%
  41. ÄÌ:
  42. ÄÖ:
  43. ÄàFxstep%=(9-printmode%)>>1   :ô xstep%=1 or 2 for printmode%=7 or 5.
  44. Äê:
  45. Äô:
  46. Äþ%ô *FX 3,10 sends to printer only.
  47. Å *FX 3,10
  48. Å/ï 27,64          :ô Initialise the printer.
  49. Å=ï 27,65,8        :ô 8/72" line spacing = 8 dots per line.
  50. Å&/ï 27,108,margin% :ô Left margin is margin%.
  51. Å0Hpoints%=((right%-left%)>>xstep%)+1 : ô No. of printed dots per line.
  52. Å:>xstep%=xstep%<<1   :ô xstep%=2 or 4 for printmode%=7 or 5.
  53. ÅD:
  54. ÅNõ
  55. ÅXEï 27,42,(9-xstep%),points%◰&100,points%Ŵ&100 :ô Set printer mode.
  56. Åb;horizpsn%=left%      :ô Scan screen from left to right.
  57. Ålõ
  58. ÅvDprintcode%=0         :ô Initialise the code sent to the printer.
  59. Å€Bpixel%=7             :ô Pixels are scanned from top to bottom.
  60. Å⇩õ
  61. œx%=horizpsn%
  62. Åfiy%=line%-28+(pixel%<<2)
  63. Ũ?colour%=°x%,y%) :ô Read the colour of the point at (x%,y%).
  64. Ų*ç colour%>threshold% … dot%=1 ⇧ dot%=0
  65. ż9printcode%+=(dot%<<pixel%) :ô Add "dot" to printcode.
  66. ÅÆ=pixel%-=1            :ô Decrement the pixel loop counter.
  67. ÅÐ<ý pixel%<0       :ô 8 pixels make 1 strike of printhead.
  68. ÅÚ9ï printcode%       :ô Send one strike to the printer.
  69. ÅäHhorizpsn%+=xstep%    :ô Increment the horizontal position by xstep%.
  70. Åîý horizpsn%>right%
  71. Åø5ï 13,10            :ô Carriage return, line feed.
  72. Æ<line%-=32            :ô Decrement the line loop counter.
  73. Æ ý line%<bottom%
  74. Æ0ï 12               :ô Form feed the printer.
  75. Æ ,ï 27,64            :ô Reset the printer.
  76. Æ*.ô *FX 3,0 sends output to the screen only.
  77. Æ4 *FX 3,0
  78. Æ>    ="OK"
  79. ÆH:
  80. ÆR:
  81. Æ\:
  82. Æf:
  83. ÿ